package com.znxs.zuopao_c.service;

import com.znxs.zuopao_c.domain.Request.TeamExitRequest;
import com.znxs.zuopao_c.domain.Request.TeamJoinRequest;
import com.znxs.zuopao_c.domain.Request.TeamUpdateRequest;
import com.znxs.zuopao_c.domain.Team;
import com.baomidou.mybatisplus.extension.service.IService;
import com.znxs.zuopao_c.domain.User;
import com.znxs.zuopao_c.domain.dto.TeamQuery;
import com.znxs.zuopao_c.domain.vo.TeamUserVO;

import java.util.List;

/**
* @author znxs
* &#064;description  针对表【team(队伍)】的数据库操作Service
* &#064;createDate  2023-09-24 06:03:47
 */
public interface TeamService extends IService<Team> {

    /**
     * 创建队伍
     * @param team 队伍
     * @param loginUser 当前用户
     * @return 队伍id
     */
    long addTeam (Team team, User loginUser);

    /**
     * 搜索队伍
     *
     * @param teamQuery 搜索队伍参数
     * @param isAdmin 是否为管理员
     * @return 队伍列表 (脱敏)
     */
    List<TeamUserVO> listTeams(TeamQuery teamQuery, Boolean isAdmin);


    /**
     * 修改队伍
     * @param teamUpdateRequest 修改队伍参数
     * @param userLogin 登录用户信息
     * @return 是否修改成功
     */
    boolean updateTeam(TeamUpdateRequest teamUpdateRequest, User userLogin);

    /**
     * 用户加入队伍
     * @param teamJoinRequest 用户加入参数
     * @param userLogin 登录用户信息
     * @return 是否加入成功
     */
    boolean joinTeam(TeamJoinRequest teamJoinRequest,User userLogin);

    /**
     * 退出队伍
     * @param teamId 用户退出队伍id
     * @param loginUser 登录用户信息
     * @return 是否退出队伍成功
     */
    boolean exitTeam(long teamId, User loginUser);

    /**
     * 删除队伍
     * @param teamId 删除队伍id
     * @param loginUser 登录用户信息
     * @return 是否删除队伍
     */
    boolean deleteTeam(long teamId, User loginUser);
}
